//
//  LoginAPIManager.m
//  Learn
//
//  Created by zyl_macbookpro on 2024/3/30.
//  Copyright © 2024 迟建国. All rights reserved.
//

#import "LoginAPIManager.h"

@implementation LoginAPIManager
+ (void)LoginWithParam:(NSDictionary *)param result:(void(^)(NSDictionary *dic))resultBlock
{
    NSString *url = [NSString stringWithFormat:@"%@%@",BaseUrl,KM_API_User_Login_Url];
    [BaseRequest basePOST:url cache:NO autoHideLoading:NO parms:param result:^(id resultObject, NSError *error) {
        
        resultBlock(resultObject);
    }];
}
+ (void)GetSchoolListWithParam:(NSDictionary *)param result:(void(^)(NSDictionary *dic))resultBlock
{
    NSString *url = [NSString stringWithFormat:@"%@%@",BaseUrl,KM_API_GetSchoolList_Url];
    [BaseRequest basePOST:url cache:NO autoHideLoading:NO parms:param result:^(id resultObject, NSError *error) {
         NSDictionary *dic = (NSDictionary *)resultObject;
        if ([dic[@"code"] intValue] != 1) {
            [SVProgressHUD showImage:nil status:dic[@"msg"]];
            return;
        }
        resultBlock(resultObject);
    }];
}
+ (void)GetAddressListWithParam:(NSDictionary *)param result:(void(^)(NSDictionary *dic))resultBlock
{
    NSString *url = [NSString stringWithFormat:@"%@%@",BaseUrl,KM_API_Area_Url];
    [BaseRequest basePOST:url cache:NO autoHideLoading:NO parms:param result:^(id resultObject, NSError *error) {
         NSDictionary *dic = (NSDictionary *)resultObject;
        if ([dic[@"code"] intValue] != 1) {
            [SVProgressHUD showImage:nil status:dic[@"msg"]];
            return;
        }
        resultBlock(resultObject);
    }];
}
+ (void)SendSMSWithParam:(NSDictionary *)param result:(void(^)(NSDictionary *dic))resultBlock
{
    NSString *url = [NSString stringWithFormat:@"%@%@",BaseUrl,KM_API_SMS_Url];
    [BaseRequest basePOST:url cache:NO autoHideLoading:NO parms:param result:^(id resultObject, NSError *error) {
         NSDictionary *dic = (NSDictionary *)resultObject;
        if ([dic[@"code"] intValue] != 1) {
            [SVProgressHUD showImage:nil status:dic[@"msg"]];
            return;
        }
        resultBlock(resultObject);
    }];
}
+ (void)ChechPhoneNumberWithParam:(NSDictionary *)param result:(void(^)(NSDictionary *dic))resultBlock
{
    {
        NSString *url = [NSString stringWithFormat:@"%@%@",BaseUrl,KM_API_CheckPhoneNumber_Url];
        [BaseRequest basePOST:url cache:NO autoHideLoading:NO parms:param result:^(id resultObject, NSError *error) {
             NSDictionary *dic = (NSDictionary *)resultObject;
        if ([dic[@"code"] intValue] != 1) {
            [SVProgressHUD showImage:nil status:dic[@"msg"]];
            return;
        }
        resultBlock(resultObject);
        }];
    }
}
+ (void)FoundPwdWithParam:(NSDictionary *)param result:(void(^)(NSDictionary *dic))resultBlock
{
    NSString *url = [NSString stringWithFormat:@"%@%@",BaseUrl,KM_API_RetriePwd_Url];
    [BaseRequest basePOST:url cache:NO autoHideLoading:NO parms:param result:^(id resultObject, NSError *error) {
        resultBlock(resultObject);
    }];
}
@end
